package com.xindacloud.sms.portal.handler;


import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;


@Slf4j
@RestControllerAdvice
@ConditionalOnClass(name = "com.xindacloud.sms.portal.config.UnionResultAspect")
@SuppressWarnings("ALL")
public class SmsOuterExceptionHandler extends AbstractSmsExceptionHandler {

    @ExceptionHandler(Exception.class)
    @ResponseStatus(HttpStatus.OK)
    @ResponseBody
    public Object transferInnerException(Exception e) {
        log.error("SmsOuterExceptionHandler", e);
        return transferException(e);
    }

}

